package BehavioralMode.responsibility.askforleave;

/**
 * 抽象处理者对象
 */
public abstract class Handler {
    private Handler nextNode;
    private final Integer maxDays;

    public Handler(Integer maxDays) {
        this.maxDays = maxDays;
    }



    public abstract void handingBusiness(Integer daysNum);

    public void setNextNode(Handler nextNode) {
        this.nextNode = nextNode;
    }

    protected Boolean isCurrentHander(Integer num){
        if(num < this.maxDays) return true;
        if(nextNode != null){
            nextNode.handingBusiness(num);
        }else{
            System.out.println("没人处理这个请假申请");
        }
        return false;
    }





}
